<template>
	<view class="app">
		

		<view class="u-m-t-20">
			<u-cell-group><u-cell icon="edit-pen-fill" title="用户信息重置" :isLink="true" arrow-direction="right" @click="updateInfo"></u-cell></u-cell-group>
		</view>

		<view class="u-m-t-20">
			<u-cell-group><u-cell icon="edit-pen-fill" title="重置密码" :isLink="true" arrow-direction="right" @click="authReset"></u-cell></u-cell-group>
		</view>

		<view class="u-m-t-20">
			<u-cell-group><u-cell icon="edit-pen-fill" title="关于我们" :isLink="true" arrow-direction="right"></u-cell></u-cell-group>
		</view>
		
		
		<view class="u-m-t-20 exit">
			<u-button type="success" text="退出登录" @click="cerla"></u-button>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			
		};
	},
	methods: {
		cerla() {
			uni.showModal({
				title: '提示',
				content: '是否退出登录',
				success: res => {
			  if (res.confirm) {
						this.$post(this.API.authLogout).then(res => {
							setTimeout(() => {
								this.$u.vuex('vuex_token', null);  //退出清空token
								this.$u.vuex('vuex_user', {});   //退出清空用户信息
								this.$u.route({
									type: 'reLaunch',
									url: '/pages/index/index'
								});
							}, 1000);
		
							uni.showToast({
								title: '退出成功'
							});
						});
					} else if (res.cancel) {
						console.log('用户点击取消');
					}
				}
			});
		},
		updateInfo(){
			uni.navigateTo({
				url:'./updateInfo',
			})
		},
		authReset(){
			uni.navigateTo({
				url:'./authReset',
			})
		}
	}
};
</script>

<style lang="scss">
page {
	background-color: #ededed;
}

.exit{
	position: absolute;
	bottom: 100px;
   .u-button{
	 margin-left: 200rpx;
	   width: 200rpx;
   }
}
.camera {
	width: 54px;
	height: 44px;
}
.user-box {
	background-color: #fff;
}
</style>
